package org.example.L04_02_abstract;

//抽象
public class L04_MyMainClass {
    public static void main(String[] args) {

//       L04_abstract myObj= new L04_abstract();   报错

        L04_pig myPig= new L04_pig();   //使用L04_pig子类对象，引用新创建的L04_pig对象
        myPig.animalSound();
        myPig.sleep();

        L04_abstract animal =new L04_pig();    //使用L04_abstract父类对象，引用新创建的L04_pig对象
        animal.animalSound();
        animal.sleep();

//        System.out.println("Hello java!");
    }
}

/*
* "D:\A Ahomework\IDEA\jdk\corretto-17.0.12\bin\java.exe" "-javaagent:D:\JetBrains\IntelliJ IDEA 2023\IntelliJ IDEA 2022.3.1\lib\idea_rt.jar=60659:D:\JetBrains\IntelliJ IDEA 2023\IntelliJ IDEA 2022.3.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\A Ahomework\IDEA\javawork\hello_java\target\classes" org.example.L04_02.L04_MyMainClass
    小猪说：oink-oink!
    Zzz
    小猪说：oink-oink!
    Zzz

    Process finished with exit code 0
* */
